<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>hamNeggs</title>
  <meta name="description" content=""/>
  <meta name="keywords" content="scrum,agile,project management"/>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1"/>
<style type="text/css">
		<%@ include file="/WEB-INF/css/style.css" %>
		<%@ include file="/WEB-INF/css/data_table_style.css" %>
	</style>
	<script src="jquery-1.4.4.min.js"> </script>
	
	<!-- Load DataTables resources  -->
	<script src="jquery.dataTables.js"> </script>
	
<script type="text/javascript">
	$(document).ready(function() {
	    $('#tableData').dataTable();
	    $('#tableData2').dataTable();
	} );
	$('#tableData').dataTable( {
        "aaSorting": [[ 1, "desc" ]],
		"sPaginationType": "full_numbers"
    } );
	$('#tableData2').dataTable( {
        "aaSorting": [[ 1, "desc" ]],
		"sPaginationType": "full_numbers"
    } );
</script>
</head>
<body>
<div class="page-out">
<div class="page-in">
<div class="page">
<div class="main">
<div class="header">
<div class="header-top">
<h1><span>HamNeggs</span> Scrum App</h1>
</div>
<div class="header-bottom">
<h2>an easy web app for managing<br/>
your scrum projects.</h2>
</div>
<div class="topmenu">
<ul>
  <li
 style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; padding-left: 0px;">
 <a href="Admin"><span>Admin Options</span></a></li>
	<li><a href="Login?action=logout">Logout</a></li>
</ul>
</div>
</div>
<div class="content">
<h2 class="sidebar1">Administration page</h2>

			<h3>Project Management</h3>
				<div id="contentResultsTable">
					<p align="right"><a href="ProjectDetails?newProject=true" onclick="javascript:void window.open('ProjectDetails?newProject=true','1','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/plus.jpeg"/></a></p>
	                    <br /><br />
	                        <table cellpadding="0" cellspacing="0" border="0" id="tableData" class="display">
	                            <thead> 
	                                <tr>
	                                    <th scope="col">Id</th>
	                                    <th scope="col">Name</th>
	                                    <th scope="col">Date Start</th>
	                                    <th scope="col">Date End</th>
	                                    <th scope="col">Scrum Master</th>
	                                    <th scope="col">User Stories</th>
	                                    <th scope="col">Sprints</th>
	                                    <th scope="col">Meetings</th>
	                                    <th scope="col">Workers</th>
	                                    <th scope="col">Actions</th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                            <c:forEach items="${projects}" var="project">	                              
	                              <tr>
	                                  <td><c:out value="${project.id}"/></td>
	                                  <td><c:out value="${project.name}"/></td>
	                                  <td><c:out value="${project.dateStart}"/></td>
	                                  <td><c:out value="${project.dateEnd}"/></td>
	                                  <td><c:out value="${project.scrumMaster}"/></td>
	                                  <td><c:if test="${project.userStories != null}"><c:out value="${project.userStories.size()}"/></c:if></td>
	                                  <td><c:if test="${project.sprints != null}"><c:out value="${project.sprints.size()}"/></c:if></td>
	                                  <td><c:if test="${project.meetings != null}"><c:out value="${project.meetings.size()}"/></c:if></td>
	                                  <td><c:if test="${project.worker != null}"><c:out value="${project.worker.size()}"/></c:if></td>
	                                  <td>
						            	<form action="Admin" method="post">
											<input type="hidden" name="prjid" value="${project.id}"/>
							 				<input id="minus" type="submit" id="minus" name="action" value="DeleteProject"/>
						 					<a href="ProjectDetails?prjid=${project.id}" onclick="javascript:void window.open('ProjectDetails?prjid=${project.id}','2','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/edit.jpeg"/></a>
						 				</form>
	                                  </td>
	                              </tr>	   
	                              </c:forEach>                         
	                            </tbody>
	                        </table>
            		</div> 
	                    <br /><br />
	                    <br /><br />
            	<h3>User Management</h3>
            		<div id="contentResultsTable">
            		<p align="right"><a href="ProjectDetails?newUser=true" onclick="javascript:void window.open('ProjectDetails?newUser=true','2','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/plus.jpeg"/></a></p>
	                    <br /><br />
	                        <table cellpadding="0" cellspacing="0" border="0" id="tableData2" class="display">
	                            <thead> 
	                                <tr>
	                                    <th scope="col">Id</th>
	                                    <th scope="col">Name</th>
	                                    <th scope="col">Full Name</th>
	                                    <th scope="col">Projects</th>
	                                    <th scope="col">User Stories</th>
	                                    <th scope="col">Actions</th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                            <c:forEach items="${users}" var="user">	                              
	                              <tr>
	                                  <td><c:out value="${user.id}"/></td>
	                                  <td><c:out value="${user.name}"/></td>
	                                  <td><c:out value="${user.fullName}"/></td>
	                                  <td><c:if test="${user.works != null}"><c:out value="${user.works.size()}"/></c:if></td>
	                                  <td><c:if test="${user.userStories != null}"><c:out value="${user.userStories.size()}"/></c:if></td>
	                                  <td>
						            	<form action="Admin" method="post">
											<input type="hidden" name="usrid" value="${user.id}"/>
											<input id="minus" type="submit" id="minus" name="action" value="DeleteUser"/>		
						 				<a href="ProjectDetails?usrid=${user.id}" onclick="javascript:void window.open('ProjectDetails?usrid=${user.id}','2','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/edit.jpeg"/></a>
						 				</form>
	                                  </td>
	                              </tr>	   
	                              </c:forEach>                         
	                            </tbody>
	                        </table>
            		</div> 


</div>
<div class="footer">
<!--DO NOT Remove The Footer Links-->
<a href="http://www.htmltemplates.net">
<img src="images/footer.gif" alt="html templates" border="0" height="1" width="1"/></a>
<p>&copy; Copyright 2013. By Estefania Rabadan<br/>
</p>
<ul>
  <li style="border-left: medium none;"><a href="index.html"><span>Home</span></a></li>
  <li><a href="#"><span>Contact</span></a></li>
  <li><a href="#"><span>Resources</span></a></li>
  <li style="padding-right: 0px;"><a href="#"><span>Links</span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
